﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using com.ubosi.model.Spider;
using com.ubosi.spider.core.Net;
using com.ubosi.common;
using System.Xml;

namespace com.ubosi.spider.hotel
{
    public class SpiderElongHotelInfo
    {
        private string CityHotelListUrl = "http://www.elong.com/seotemplate/interface/CityHotelBaseInfoList.aspx?cityid={0}";
        public List<HotelBaseInfo> GetHotelListInfo(string cityId,NetSpider netSpider)
        {
            string xml = netSpider.GetXmlDocument(string.Format(CityHotelListUrl, cityId));
            try
            {
                List<HotelBaseInfo> list = (List<HotelBaseInfo>)SerializerUtility.DeSerializeFromXmlString(typeof(List<HotelBaseInfo>),xml);
                
                return list;
            }
            catch(Exception ex)
            {
                return null;
            }
        }        
    }
}
